package cn.wolfcode.qo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

// 门店分页过滤查询的参数
@Setter
@Getter
public class BusinessQueryObject extends QueryObject {
    private String name;
    private String scope;
    private String tel;
    private String legalName;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;


    public String getName(){
        //判断字符串是否有内容   不是null   也不是 ""
        //if(name != null && !"".equals(name))
        return StringUtils.hasText(name)? name : null;
    }

    public String getScope(){
        return StringUtils.hasText(scope)? scope : null;
    }
    public String getTel(){
        return StringUtils.hasText(tel)? tel : null;
    }

    public String getLegalName(){
        return StringUtils.hasText(legalName)? legalName : null;
    }

}
